#include "../comm.h"
class Solution {
public:
    bool detectCapitalUse(string word) {
        bool have_lt = false, have_b = false;
        for(int i = 0; i < word.size(); ++i)
        {
            char ch = word[i];
            if(ch >= 'a' && ch <= 'z')
            {
                have_lt = true;
                if(have_b)
                    return false;
            }
            else if(ch >= 'A' && ch <= 'Z')
            {
                if(i) have_b = true;
                if(have_lt)
                    return false;
            }
        }
        return true;
    }
};